package com.wanmait.gohome.job;

import com.wanmait.gohome.service.InformationService;
import com.wanmait.gohome.service.JournalService;
import com.wanmait.gohome.service.TaskService;
import com.wanmait.gohome.util.SysContext;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class Job1 {

    @Resource
    private TaskService taskService;
    @Resource
    private JournalService journalService;
    @Resource
    private InformationService informationService;

    @Scheduled(cron = "0 0 0 * * ?")
    public void clearTodayHot()
    {
        taskService.clearTodayHot();
        journalService.clearTodayHot();
    }




    @Scheduled(cron = "0 10 0 * * ?")
    public void clear()
    {
        System.out.println("************");
        String path = "D:\\GoHome\\target\\GoHome\\web\\uploadImages\\";
        informationService.auotmatch(path);

    }


}
